<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('重点监控列表')" />
    <th:block th:include="include :: jq-viewer-css" />
    <style type="text/css">
        #imageBox img{width:100%;display:none}
        body{
            border-style: solid;
            border-width: 1px;
        }
        <!--任务获取框  -->
        /*.shadowButton{*/
        /*    height:23px;*/
        /*    BORDER-RIGHT: #003c74 1px solid;*/
        /*    PADDING-RIGHT: 2px; BORDER-TOP: #003c74 1px solid;*/
        /*    PADDING-LEFT: 2px; FONT-SIZE: 12px;*/
        /*    BORDER-LEFT: #003c74 1px solid;*/
        /*    CURSOR: hand;*/
        /*    COLOR: black;*/
        /*    PADDING-TOP: 2px;*/
        /*    BORDER-BOTTOM: #003c74 1px solid;*/
        /*    filter: progid:DXImageTransform.Microsoft.Shadow(color=#999999,direction=135,strength=5);*/
        /*}*/
    </style>
</head>
<!--全局js -->
<script th:src="@{/js/commonTool.js}"></script>

<body onKeyDown="doKeyDown(event.keyCode);" class="gray-bg">
<script th:inline="javascript">
    var g_radioValue = "1";//默认为未监督
    var g_arc_id;
    //遮罩层
    $.modal.loading("数据加载中......");
</script>
<!--
监控流水列表区域
-->
<div class="box" style="width:20%;left: 15px;top: 5px">
    <div class="box-header">
        <span id="titleContext" style="color:blue;font-weight:bold;position: absolute;"></span>
    </div>
    <div class="box-main" style="height: 100px">
        <table width="98%">
            <tr th:height="70">
                <td colspan="4">
                    <div id="auditTitle1" style="padding-left: 15px;padding-top: 15px"></div>
                </td>
            </tr>
            <tr height="30" style="border-top-style: solid;border-top-width: 1px;">
                <td style="padding-left: 5px">
                    <input type="radio" id="auditType1" name="auditType" value="1" checked="checked" onclick="g_radioValue=this.value;showRows('1')">未监控
                </td>
                <td style="padding-left: 5px">
                    <input type="radio" id="auditType2" name="auditType" value="2" onclick="g_radioValue=this.value;showRows('2')">正常
                </td>
                <td style="padding-left: 5px">
                    <input type="radio" id="auditType3" name="auditType"  value="3" onclick="g_radioValue=this.value;showRows('3')">督办
                </td>
                <td style="padding-left: 5px">
                    <input type="radio" id="auditType4" name="auditType" value="all" onclick="g_radioValue=this.value;showRows('ALL')">全部
                </td>
            </tr>
        </table>
    </div>
</div>
<!-- 监控项区域 -->
<div th:include="oms/paeaAuAuditItem/auBatchItemList :: auBatchItemList"></div>
<!--弹框 -->
<!--<div id="auditToolBar"-->
<!--     style="background-image: url('/img/task_001.png');-->
<!--     width: 400px;height: 300px;left: 34%;top: 25%;z-index: 999999;position: absolute;display: inline;-->
<!--     filter: shadow(navy,135,5)">-->
<!--    <table align=right width="100%" height="30">-->
<!--        <tr>-->
<!--            <td align=right>-->
<!--                <a name="closeBar" onclick="hideAuditToolBar()">[关闭]</a>-->
<!--            </td>-->
<!--            <td width="5"></td>-->
<!--        </tr>-->
<!--    </table>-->
<!--    <table align=center width="100%" height="90%" style="margin-top:30px;">-->
<!--        <tr height=20>-->
<!--            <td align=center></td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td align=center>-->
<!--                <input onclick="auditListTaskRandom()"  style="font-weight:bold; font-family:'微软雅黑';height:45px;font-size:15px" type=button class="btn btn-sm btn-primary" value=" 获 取 随 机 监 督 (F1)">-->
<!--            </td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td align=center>-->
<!--                <input onclick="auditListTask()"  style=" font-weight:bold; font-family:'微软雅黑';height:45px;font-size:15px" type=button class="btn btn-sm btn-primary" value=" 选 择 列 表 监 督 (F2)">-->
<!--            </td>-->
<!--        </tr>-->
<!--        <tr>-->
<!--            <td align=center>-->
<!--                <input onclick="window.close();"  style="  font-weight:bold;font-family:'微软雅黑';height:45px;font-size:15px"  type=button class="btn btn-sm btn-primary"  value=" 退 出 人 工 监 督 (F3)">-->
<!--            </td>-->
<!--        </tr>-->
<!--    </table>-->
<!--</div>-->

<!-- 影像区域 -->
<div style="position: absolute;top: 0px;left: 22%;width: 77%">
    <div align="center">
<!--        <button type="button" class="btn btn-rounded btn-primary" onclick="toggle()">最佳</button>-->
<!--        <button type="button" class="btn btn-rounded btn-primary" onclick="zoomIn()">放大</button>-->
<!--        <button type="button" class="btn btn-rounded btn-primary" onclick="zoomOut()">缩小</button>-->
    </div>
    <div class="box" style="top: 5px">
        <div class="box-header">
        <button type="button" class="btn btn-rounded btn-primary" id="randomBT"  onclick="auditListTaskRandom()" >获取随机监督</button>
        <button type="button" class="btn btn-rounded btn-primary" id="obtainBT"  onclick="auditListTask()" >选择列表监督</button>
        <button type="button" class="btn btn-rounded btn-primary" onclick="window.close()" >退出人工监督</button>
        <div class="btn-group">
            <button data-toggle="dropdown" class="btn btn-rounded btn-primary dropdown-toggle">监督小助手</button>
            <ul class="dropdown-menu">
                <li><a href="#" onclick="commonSearch('账号/卡号查询',ctx+'query/paeaDsLink')">账号/卡号查询</a>
                </li>
                <li><a href="#" onclick="commonSearch('交易码查询',ctx+'para/paeaParaTxnCde')">交易码查询</a>
                </li>
                <li><a href="#" onclick="writeLog();">监控日志</a>
                </li>
                <li><a href="#" onclick="commonSearch('网点基本情况查询',ctx+'para/authorizer')">网点基本情况查询</a>
                </li>
                <li><a href="#" onclick="commonSearch('汇率查询',ctx+'para/smActXrt')">汇率查询</a>
                </li>
                <li class="divider"></li>
                <li><a href="#" onclick="_querySignature()">有权人签字</a></li>
            </ul>
        </div>
    </div>
        <div class="box-main">
            <div id="imageBox" style="height:508px;">
            </div>
        </div>
    </div>
</div>

<!--监控信息基本信息区域  -->
<div style="position: absolute;width: 100%;left: 15px;bottom: 30px">
    <div th:include="oms/paeaAuAuditItem/auBatchItemDetail :: auBatchItemDetail"></div>
</div>

<!-- 操作按钮 -->
<div id="btnsDiv" align="center" style="bottom: 1px;position: absolute;width: 99%;display: inline">
    <input type=button class="btn btn-sm btn-primary" style='width:85px;' id="normalBT" value='正常确认(F1)' onclick="submitAuditItem();">
    <input type=button class="btn btn-sm btn-primary" style='width:85px;' id="batchBT" value='批量提交(F2)' onclick="submitBatch(null);">
    <input type=button class="btn btn-sm btn-primary" style='width:85px;' id="cancelBT" value='取消监控(F3)' onclick="cancelAuditItem();">
    <input type=button class="btn btn-sm btn-primary" style='width:85px;' id="createErrBT" value='创建督办(F4)' onclick="createError();">
    <input type=button class="btn btn-sm btn-primary" style='width:65px' id="viewErrBT" value='查看督办' onclick="queryAuItemError()">
    <input type=button class="btn btn-sm btn-primary" style='width:65px' id="queryTradeBT" value='流水查询' onclick="_queryTrade()">
<!--    <input type=button class="btn btn-sm btn-primary" style='width:85px' value='任务选择(F8)' onclick="showAuditToolBar()">-->
    <input type=button class="btn btn-sm btn-primary" style='width:65px' id="viewTradeBT" value='流水详情' onclick="queryAuItemTrade();">
    <input type=button class="btn btn-sm btn-primary" style='width:90px' id="telrImgBT" value='查看柜员影像' onclick="manualInputDetail();">
<!--    <input type=button class="btn btn-sm btn-primary" style='width:90px' id=""  value='创建补录差错' disabled onclick="alert('暂未开发')//_addbulu();">-->
    <input type=button class="btn btn-sm btn-primary" style='width:65px;' id="loseBillBT" value='登记缺票' onclick="signLoseBill();">
    <input type=button class="btn btn-sm btn-primary" style='width:65px' value='关闭窗口'  onclick="window.close()">
</div>
<!--隐藏查询条件-->
<input id="beginDate1"  name="beginDate1" type="hidden">
<input id="endDate1"  name="endDate1" type="hidden">
<input id="orgId1"  name="orgId1" type="hidden">
<input id="batchType1"  name="batchType1" type="hidden">
<input id="status1"  name="status1" type="hidden">
<input id="id"  name="id" type="hidden">
<input id="queryFlag"  name="queryFlag" th:value="${queryFlag}" type="hidden">
<input id="isViewOnly"  name="isViewOnly" th:value="${isViewOnly}" type="hidden">
<input id="arcId"  name="arcId" th:value="${arcId}" type="hidden">
<th:block th:include="include :: jq-viewer-js" />
<th:block th:include="include :: keyMoney-js" />

<!--快捷方式function  -->
<script th:inline="javascript">
    //queryFlag 区分 重点监控 及 随机抽查
    var queryFlag = $("#queryFlag").val();
    //isViewOnly 区分 质量检查查看 及 重点监控操作
    var isViewOnly = $("#isViewOnly").val();
    var arcId = $("#arcId").val();
   //初始化 如果 质量检查功能 传值 isViewOnly 为true 时执行
    $(function () {
        if(isViewOnly == "true"){
            auditTaskById();
            $("#normalBT").attr("disabled",'disabled');
            $("#batchBT").attr("disabled",'disabled');
            $("#cancelBT").attr("disabled",'disabled');
            $("#createErrBT").attr("disabled",'disabled');
            $("#loseBillBT").attr("disabled",'disabled');
            $("#viewErrBT").attr("disabled",'disabled');
            $("#queryTradeBT").attr("disabled",'disabled');
            $("#viewTradeBT").attr("disabled",'disabled');
            $("#telrImgBT").attr("disabled",'disabled');
            $("#randomBT").attr("disabled",'disabled');
            $("#obtainBT").attr("disabled",'disabled');
        }
    })

    // function doKeyDown(keyCode) {
    //     //F1 112 正常提交
    //     if (keyCode == 112) {
    //         if (document.all.auditToolBar.style.display == 'none') {
    //             submitAuditItem();
    //         } else {
    //             auditListTaskRandom();
    //         }
    //     }
    //     //F2 118 批量提交
    //     if (keyCode == 113) {
    //         submitBatch(null);
    //     }
    //     //F3 114 取消监控
    //     if (keyCode == 114) {
    //         if (document.all.auditToolBar.style.display == 'none') {
    //             cancelAuditItem();
    //         } else {
    //             window.close();
    //         }
    //     }
    //     //F4 115 创建督办
    //     if (keyCode == 115) {
    //         if (document.all.auditToolBar.style.display == 'none') {
    //             createError();
    //         } else {
    //             auditListTask();
    //         }
    //     }
    //     //F9 119 关闭监控
    //     if (keyCode == 120) {
    //         window.close();
    //     }
    // }
</script>
<!-- 初始化影像 -->
<script th:inline="javascript">
    $(function () {
    //初始化影像区域
    initImageArea();
    //初始化影像
    initImage();
    })
    //初始化影像显示
    function initImageArea() {
    //加载一张默认图片
        $('#imageBox').append('<img name= "img'+'demo'+'" id="imgArea" src="" alt="示例图片">');
        $('#imageBox').viewer({inline:true}).viewer('update');
    }
    //初始化影像
    function initImage() {
        var imgUrl = "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1584958911886&di=47b6a313b01424ad2593609115dbd145&imgtype=0&src=http%3A%2F%2Fbbsfiles.vivo.com.cn%2Fvivobbs%2Fattachment%2Fforum%2F201507%2F31%2F161843qkvv4oq21nrvtjui.jpg";
        $('#imgArea').attr("src", imgUrl);
        $('#imageBox').viewer({inline:true}).viewer('update');
    }
    // function zoomIn() {
    //     $('#imageBox').viewer.zoom(0.1);
    // }
    //
    // function zoomOut() {
    //     $('#imageBox').viewer.zoom(-0.1);
    // }
    // function toggle() {
    //     $('#imageBox').viewer.toggle();
    // }
</script>
<!--弹框function -->
<script th:inline="javascript">
    //隐藏任务选择弹框
    // function hideAuditToolBar(){
    //     $.modal.closeLoading();
    //     document.getElementById('auditToolBar').style.display="none";
    // }
    // //显示任务选择弹框
    // function showAuditToolBar(){
    //     $.modal.loading("数据加载中......");
    //     document.getElementById('auditToolBar').style.display="inline";
    // }
</script>
<!--监督助手function  -->
<script th:inline="javascript">
    function commonSearch(title,src){
        var returnValue = window.showModalDialog(src,title,"dialogWidth=950px; dialogHeight=550px; help=no; status=no; scroll=yes; resizable=no;");
    }
    function writeLog(){
        $.operate.post(ctx + "wt/auditDaylogQuery/doCheckDayLogExists","",function (result) {
            if (result.code == web_status.SUCCESS) {
                var rt = result.msg;
                var openUrl = "";
                if(rt == "false"){
                    openUrl = ctx + "wt/auditDaylogCreate/add";
                }
                else{
                    openUrl =  ctx + "wt/auditDaylogCreate/modify/{id}";
                    openUrl = openUrl.replace("{id}",rt);
                }
                commonSearch('监控日志',openUrl);
            } else if (result.code == web_status.WARNING) {
                $.modal.alertWarning(result.msg)
            } else {
                $.modal.alertError(result.msg);
            }
            $.modal.closeLoading();
        });
    }

    /**
     * 有权人签字
     * @private
     */
    // function _querySignature(){
    //     var orgCode = document.all.orgId.value;
    //     if(orgCode==""){
    //         alert("监控列表中没有数据");
    //         return;
    //     }
    //     var url = "<%=Parameters.pathPrefix%>smSignature.do?method=query&orgCode="+orgCode;
    //     searchAccCard('有权人签字',url);
    // }
</script>

<!--其他function -->
<script th:inline="javascript">
    //批量提交
    function submitBatch(batchId) {
        if(null!=arcId){
            batchId=arcId;
        }
        //item表的主键
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        if(null==row){
           // $.modal.alertWarning("监控列中没有数据");
            $.modal.msgWarning("监控列表中不存在数据！");
            return;
        }
        var trDate = row.trDate;
        $.modal.loading("数据加载中......");

        $.modal.confirm("确认要批量提交吗?", function() {
            var url = ctx + "oms/paeaAuBatch/submitAuBatch";
            var data = {"id":batchId,"trDate":trDate,"queryFlag":queryFlag};
            $.operate.post(url,data,function(result){
                if(result.code==web_status.SUCCESS){
                    var returnString = result.returnString;
                    if(returnString != 0){
                        $.modal.alertWarning("还有" + returnString + "条监控项没有监控，无法提交批量");
                    }else{
                        if (confirm("监控内容提交成功,是否进入下一监控操作？")){
                            //随机获取
                            auditListTaskRandom();
                        }else{
                            //显示列表
                            auditListTask();
                        }
                    }
                } else {
                    $.modal.msgError(result.msg());
                }
            })
        });
    }

    //取消监控
    function cancelAuditItem() {
        //item表的主键
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        if(null==row){
            //$.modal.alertWarning("监控列中没有数据");
            $.modal.msgWarning("监控列表中不存在数据！");
        }else{
            var url = "";
            var data = {};
            var checkUrl = ctx+ "oms/paeaAuAuditItem/checkCancelError";
            var checkData = {"id": row.id, "trDate": row.trDate, "vchNo" : row.vchNo};
            $.operate.post(checkUrl,checkData,function(result){
                if(result.code==web_status.SUCCESS){
                    var returnString = result.returnString;
                    var rt = returnString.split("|");
                    if(rt[0] == "1")
                    {
                        $.modal.msgError(rt[1].toString());
                        return;
                    }
                    //已保存的监控
                    if(rt[0] == "2")
                    {
                        url = ctx + "oms/paeaAuAuditItem/deletePaeaErError";
                        data = {"id" : rt[1].toString(),"auditItemId": row.id};
                    }
                    //确认正常的监控
                    if(rt[0] == "0")
                    {
                        url = ctx + "oms/paeaAuAuditItem/cancelAuditItem";
                        data = {"id": row.id,"batchId": arcId};
                    }
                    $.modal.loading("数据加载中......");
                    _cancelAuditItem(url,data,row);
                } else {
                    $.modal.msgError(result.msg());
                }
            });
        }
    }

    //提交取消
    function _cancelAuditItem(url,data,row){
        //alert(JSON.stringify(data));
        $.operate.post(url,data,function(result){
            if(result.code==web_status.SUCCESS){
                $("#bootstrap-table").bootstrapTable('updateRow',{index:paeaAuAuditItemIndex,row:{state:1}});//变更为未监控
                showRows("1");
            } else {
                $.modal.msgError(result.msg());
            }
        })
    }

    //正常确认
    function submitAuditItem() {
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        if(null==row){
            //$.modal.alertWarning("监控列表中不存在数据");
            $.modal.msgWarning("监控列表中不存在数据！");
        }else{
            var trDate = row.trDate;
            var url = ctx + "oms/paeaAuAuditItem/checkAuAudit";
            var data = {"id":row.id,"trDate":trDate};
            $.operate.post(url,data,function(result){
                if(result.code==web_status.SUCCESS){
                    _submitAuditItem(row);
                } else {
                    $.modal.msgError(result.msg());
                }
            })
        }
    }

    //提交监督
    function _submitAuditItem(row) {
        $.modal.loading("数据加载中......");
        var primaryKey = row.id;
        var trDate = row.trDate;
        var subimitUrl = ctx + "oms/paeaAuAuditItem/submitAuditItem";
        var subimitData = {"id": row.id, "state": 2, "trDate": trDate, "primaryKey": primaryKey, "batchId": arcId};//auditFlag=2 正常监督
        $.operate.post(subimitUrl, subimitData, function (result) {
            if (result.code == web_status.SUCCESS) {
                $('#bootstrap-table').bootstrapTable('hideRow', paeaAuAuditItemIndex);
                $('#bootstrap-table').bootstrapTable('uncheck', paeaAuAuditItemIndex);
                $("#bootstrap-table").bootstrapTable('updateRow',{index:paeaAuAuditItemIndex,row:{state:2}});//变更为监督正常
                showRows('1');
            } else {
                $.modal.msgError(result.msg());
            }
        })
    }

    //创建督办
    function createError() {
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        if(null==row){
            $.modal.msgWarning("监控列表中不存在数据！");
        }
        else {
            var state = row.state;
            if (state == 2 || state == 3) {
                $.modal.msgWarning("不能创建督办！");
                return;
            }
            var trDate = row.trDate;
            var orgId = row.orgId;
            var tellerId = row.tellerId;
            var vchNo = row.vchNo;
            var auTypeId = row.auTypeId;
            var auditItemId = row.id;
            var tradeId = row.dsTradeId;
            var errSource = 400;//差错类型  PaeaErrorSource.S重点监控.getValue()
            var vchFlag = 1;//有流水的标识
            var manFlag = 0;//人工创建标识
            //var paeaErrorRootTypeCode="2";//PaeaErrorRootType.重点监控类风险2.getCode() 这个参数暂时没用
            //添加创建督办时提示是否已被督办
            var checkUrl = ctx + "oms/paeaAuAuditItem/checkRegisterError";
            var checkData = {"dsTradeId" : tradeId};
            $.operate.post(checkUrl, checkData, function (result) {
                if (result.code == web_status.SUCCESS) {
                    //创建督办
                    registerErrorPre(errSource,vchFlag,manFlag,trDate,orgId,tellerId,vchNo,tradeId,auTypeId,auditItemId);
                } else {
                    //$.modal.alertWarning("该流水已经登记过重点监控风险");
                    $.modal.msgWarning("该流水已经登记过重点监控风险！");
                }
            })
        }
    }

    //跳转创建督办页面，调用创建督办页面
    function registerErrorPre(errSource,vchFlag,manFlag,trDate,orgId,tellerId,vchNo,tradeId,auTypeId,auditItemId){
        var url =  ctx  + 'oms/paeaAuAuditItem/registerErrorPre?errSource='+errSource+'&vchFlag='+vchFlag+'&manFlag='+manFlag+'&trDate='+trDate+'&orgId='+orgId+'&tellerId='+tellerId+'&vchNo='+vchNo+'&tradeId='+tradeId+'&auTypeId='+auTypeId+'&auditItemId='+auditItemId;
        var flag = window.showModalDialog(url,"查询督办","dialogWidth=1000px; dialogHeight=500px; help=yes; status=yes; scroll=yes; resizable=yes;");
        if(flag){
            afterRegisterErr();
        }
    }

    //创建督办后的回调函数
    function afterRegisterErr(){
        alert("督办创建成功，执行回调函数");
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        var url = ctx + "oms/paeaAuAuditItem/afterRegisterError";
        var data = {"id":row.id, "batchId":arcId, "trDate":row.trDate };
        $.operate.post(url, data, function (result) {
            if (result.code == web_status.SUCCESS) {
                $('#bootstrap-table').bootstrapTable('hideRow', paeaAuAuditItemIndex);
                $('#bootstrap-table').bootstrapTable('uncheck', paeaAuAuditItemIndex);
                $("#bootstrap-table").bootstrapTable('updateRow',{index:paeaAuAuditItemIndex,row:{state:3}});//变更为监督督办
                showRows('1');
            } else {
                $.modal.msgError(result.msg());
            }
        })
    }

    //查询督办
    function queryAuItemError() {
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        if(null == row) {
            //$.modal.alertWarning("监控列表中没有数据");
            $.modal.msgWarning("监控列表中不存在数据！");
            return;
        }else{
            var url = ctx +"oms/paeaAuAuditItem/registerErrorView?tradeId="+row.dsTradeId;
            window.showModalDialog(url,"查询督办","dialogWidth=1000px; dialogHeight=500px; help=no; status=no; scroll=yes; resizable=no;");
            //$.modal.open("",url);
        }
    }

    //查看流水详情
    function queryAuItemTrade() {
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        if(null == row){
            //$.modal.alertWarning("监控列表中没有数据");
            $.modal.msgWarning("监控列表中不存在数据！");
            return;
        }else{
            var url = ctx + "paea/paeaDsTrade/detail/"+row.dsTradeId;
            window.showModalDialog(url,"查看流水","dialogWidth=1000px; dialogHeight=500px; help=yes; status=yes; scroll=yes; resizable=yes;");
        }
    }

    //监督列表
    function auditListTask() {
        var url = ctx+"oms/paeaAuBatch/paeaAuBatchForQuery?status=999&queryFlag="+queryFlag;
        g_arc_id = window.showModalDialog(url,"重点监控列表","dialogWidth=1000px; dialogHeight=500px; help=no; status=no; scroll=yes; resizable=no;");
        var strs= new Array();
        if(g_arc_id==null){
            return;
        }
        strs=g_arc_id.split("#");
        if(strs[0] != null)
        {
            document.getElementById("beginDate1").value=strs[1];
            document.getElementById("endDate1").value=strs[2];
            document.getElementById("orgId1").value=strs[3];
            document.getElementById("batchType1").value=strs[4];
            document.getElementById("status1").value=strs[5];
            arcId=strs[0];
            setTimeout("auditTaskById()",100);
        }
    }

    //随机值
    function auditListTaskRandom() {
        var data={queryFlag:queryFlag};
        var url = ctx + "oms/paeaAuBatch/obtainByIdRandom";
        auditByAjaxValues(url,data);
    }

    //通过列表获取监控内容
    function auditTaskById(){
        var url = ctx + "oms/paeaAuBatch/obtainById";
        var data = {"id":arcId};
        auditByAjaxValues(url,data);
    }

    function auditByAjaxValues(url,data){
        $.operate.post(url,data,function(result){
            if(result.code==web_status.SUCCESS){
                var values=result.returnString.split("###");
                //生成表头信息
                showTitle(values[1],values[0]);
                arcId=values[2];
                //生成监控信息
                document.getElementById("batchId").value=values[2];
                $("#bootstrap-table").bootstrapTable('refresh');
                $.modal.closeLoading();
            } else {
                $.modal.msgWarning(result.msg);
            }
        })
    }

    //显示 监督项列表表头信息
    function showTitle(titleContext,titleValues){
        var titles=titleValues.split("$$$");
        var contexts = titleContext.split("-");
        var title1="<table><tr><td align=right><b>监控总数</b></td><td>【<font color='red'>"+titles[3]+"</font>】</td><td><b>重点</b></td><td>【<font color='red'>"+titles[4]+"</font>】</td><td><b>随机</b></td><td>【<font color='red'>"+titles[5]+"</font>】</td>";
        var title2="<tr><td align=right><font color=blue><b>未监控</b></td><td>【<font color='red'><span id='unAuditNum'>"+titles[0]+"</span></font>】</td><td><font color=blue><b>正常</b></td><td> 【<font color='red'><span id='normalNum'>"+titles[1]+"</span></font>】</td><td><font color=blue><b>督办</b></td><td>【<font color='red'><span id='errorNum'>"+titles[2]+"</span></font>】</td></tr></table>";
        document.all.auditTitle1.innerHTML=title1 + title2;
        document.all.titleContext.innerHTML="机构:<span style = 'cursor:hand' title='"+(contexts[2])+"'>"+contexts[0]+contexts[2]+"　</span>";
        isPaused = ("0" == titles[6]);
    }
    //流水查询
    function _queryTrade(){
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        if(null == row) {
            //$.modal.alertWarning("监控列表中没有数据");
            $.modal.msgWarning("监控列表中不存在数据！");
            return;
        }else {
            var url = ctx + "paea/paeaDsTrade";
            var returnValue = window.showModalDialog(url, "", "dialogWidth=1000px; dialogHeight=600px; help=no; status=no; scroll=yes; resizable=no;");
        }
    }
    //查看柜员影像
    function manualInputDetail() {
        if(window.showModalDialog)
        {
            var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
            if(null == row) {
                $.modal.msgWarning("监控列表中不存在数据！");
                return;
            }else {
                var x = screen.availWidth;
                var y = screen.availHeight;
                var url = ctx + "oms/paeaAuAuditItem/querySdiPaeaArcId";
                var data = {"trDate": row.trDate, "orgCode": row.orgId, "tellerCode": row.tellerId};
                $.operate.post(url, data, function (result) {
                    if (result.code == web_status.SUCCESS) {
                        var arcId = result.arcId;
                        var obj = window.showModalDialog('/sdi/input/manualInputDetail/' + arcId, window, 'dialogWidth:' + x + 'px;dialogHeight:' + y + 'px;center:yes;help:yes;resizable:no;status:yes;scroll:no;');
                    } else {
                        $.modal.msgError(result.msg);
                    }
                })
            }
        }
    }
    //登记缺票
    function signLoseBill() {
        var status = $("#status").val();
        var row = $("#bootstrap-table").bootstrapTable('getSelections')[0];
        if(null == row) {
            $.modal.msgWarning("监控列表中不存在数据！");
            return;
        }else {
            var canCreate = true;
                // if (status == '1' || status == '2') {
                //     $.modal.msgWarning('已勾对流水：' + row.vchNo + ',无法登记缺票！');
                //     canCreate = false;
                //     return false;
                // }
                if (status == '3') {
                    $.modal.msgWarning('已登记缺票流水：' + row.vchNo + ',无法重复登记！');
                    canCreate = false;
                    return false;
                }
            if (canCreate) {
                $.modal.confirm("确认要将选中流水登记缺票并创建差错吗?", function () {
                    var url =  '/oms/paeaAuAuditItem/lostVoucherRegister';
                    var data = {"id": row.dsTradeId};
                    $.operate.post(url, data, function (result) {
                        if (result.code == web_status.SUCCESS) {
                            $.modal.msgWarning('缺票登记成功！');
                        } else {
                            $.modal.msgError(result.msg);
                        }
                    })
                });
            }
        }
    }
</script>
</body>
</html>
